package com.xuhao.examai.exam.infrastructure.persistence;

import com.xuhao.examai.exam.domain.models.Exam;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface ExamRepository extends JpaRepository<Exam, Long> {
	List<Exam> findByIsPublished(Boolean isPublished);

	List<Exam> findByIsPublishedTrue();

	List<Exam> findByStartTimeAfter(LocalDateTime time);

	List<Exam> findByEndTimeBefore(LocalDateTime time);

	List<Exam> findByStartTimeBeforeAndEndTimeAfter(LocalDateTime start, LocalDateTime end);
}
